package cn.tedu.order.controller;

import cn.tedu.dubbo.feign.HelloI;
import cn.tedu.fw.api.FwFeignHello;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/app/order")
@Api(tags = "order")
public class OrderController {
    @Autowired
    private FwFeignHello fwFeignHello;

    @DubboReference(check = false)
    private HelloI helloI;

    @GetMapping
    public String showHello(HttpServletRequest request)
    {
        String authorization = request.getHeader("authorization");
        System.out.println(authorization);
        return helloI.hello();
    }
}
